home *** CD-ROM | disk | FTP | other *** search
- #! /bin/sh
- # Shell script to create a Makefile from Make.conf and some standard parts.
- #
- # *** Add your hostname as a case to the 'case $HOST' statement below. ***
- #
- # This should be called only from within any of the stdwin subdirectories.
- # See the mkdep script for details about the generation of dependency lines.
-
- CONF=../conf
- export PATH; PATH="$PATH:$CONF" # So the call to make below can find mkdep
-
- # Figure out the operating system name. For now, we use a little table
- # keyed to the hostname. Hey, I'm not Larry Wall! :-)
- # You may also set the system type in the environment variable $SYSTEM.
-
- HOST=`hostname | sed 's/\..*//'`
-
- # On (some?) Suns, arch returns the system type
- case $SYSTEM in
- '') if test -f /bin/arch; then SYSTEM=`/bin/arch`; fi;;
- esac
-
- case $SYSTEM in
- '')
- # Add a line for your host(s) to this case statement.
- # The system name is only used to select a file Sys.$SYSTEM
- # below; you can define your own system types if you like.
- case $HOST in
- knoflook|bitter|porter|ober) SYSTEM=sun;;
- sob|swab|rorb|nop|xor|bis) SYSTEM=ultrix;;
- piring|sering|boring|turing|zuring) SYSTEM=bsd43;;
- reel|jive|pogo|tango|joker|gigue) SYSTEM=bsd42am;;
- *) echo 'Please set SYSTEM in environment or edit mkmk' 1>&2; exit 1;;
- esac
- ;;
- esac
-
- # Set the names of the variable/optional files;
- # replace non-existent ones by /dev/null
-
- SYSDEP=$CONF/Sys.$SYSTEM
- SITEDEP=$CONF/Site.$HOST
-
- if test ! -f $SYSDEP
- then
- # Actually not much may work if this file isn't found,
- # so we issue a warning.
- echo "Warning: $SYSDEP not found" >&2
- SYSDEP=/dev/null
- fi
-
- if test ! -f $SITEDEP
- then
- SITEDEP=/dev/null
- fi
-
- # Create the prototype Makefile by "catting" the different parts.
-
- cat $CONF/Generic $SYSDEP $SITEDEP Make.conf $CONF/Rules >@Makefile
-
- # 'make depend' calls mkdep for all source files with output to @mkdep.
-
- if make -f @Makefile depend
- then
- cat @mkdep >>@Makefile
- mv -f @Makefile Makefile
- rm @mkdep
- fi
-